#include "res.hpp"
#include <iostream>

using namespace std;

int main()
{
 string st;

 res3::c_ochered<char> *och;
 char ch, priv;
 bool alfavit;
 unsigned int i;
 
 och = new(res3::c_ochered<char>);
 
 cout << "Vvedite text:\n";
 cin >> st;
 for (i=0; i < st.length(); i++)
  if ( ((int)st[i] >= 65) && ((int)st[i] <= 90) || ((int)st[i] >= 97) && ((int)st[i] <= 122) )
	  och->push(st[i]);


 alfavit = true;
 priv = (char)0;
 while ( !och->is_empty() )
 {
	 ch = och->pop();
	 if ( (int)ch > 96 )  ch = (char)((int)ch-32);
	 if ( (priv > ch) && alfavit ) alfavit = false;
	 priv = ch;
 }
 
 if (alfavit) cout << "Simvoli v alfavitnom poryadke";
 else cout << "Simvoli ne v alfavitnom poryadke";
 
 delete och;
}
